import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

enum NoDataType { normal, shop_car }

class NoDataView extends StatelessWidget {
  final double height;
  final NoDataType type;

  NoDataView({Key? key, this.height: 300, this.type: NoDataType.normal})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    String asset = 'images/lt_common/no_data.png';
    String tips = '暂无相关数据';
    if (type == NoDataType.shop_car) {
      asset = 'images/shop_car/shop_car_empty.png';
      tips = '购物车空空如也';
    }
    return Container(
      alignment: Alignment.center,
      height: height,
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Column(
            children: [
              Image.asset(
                asset,
                width: 199.w,
                height: 124.w,
              ),
              SizedBox(
                height: 12.w,
              ),
              Text(
                tips,
                style: TextStyle(fontSize: 14.sp, color: Color(0xFF999999)),
              ),
            ],
          ),
        ],
      ),
    );
  }
}
